<?php
function init_roles()
{
	$acl = new Zend_Acl();
	//echo $this->auth->getUserGroup();

	$acl->add(new Zend_Acl_Resource('countries'));	
	$acl->add(new Zend_Acl_Resource('states'));
	$acl->add(new Zend_Acl_Resource('regions'));	
	$acl->add(new Zend_Acl_Resource('cities'));
	$acl->add(new Zend_Acl_Resource('account_types'));
	$acl->add(new Zend_Acl_Resource('credit_cards'));	
	$acl->add(new Zend_Acl_Resource('settings'));
	$acl->add(new Zend_Acl_Resource('companies'));	
	$acl->add(new Zend_Acl_Resource('pages'));
	$acl->add(new Zend_Acl_Resource('groups'));
	$acl->add(new Zend_Acl_Resource('homepage'));
	$acl->add(new Zend_Acl_Resource('categories'));
	$acl->add(new Zend_Acl_Resource('tests_categories'));
	$acl->add(new Zend_Acl_Resource('languages'));
	$acl->add(new Zend_Acl_Resource('upload'));
	$acl->add(new Zend_Acl_Resource('admins'));
	$acl->add(new Zend_Acl_Resource('users'));
	$acl->add(new Zend_Acl_Resource('emails'));	
	$acl->add(new Zend_Acl_Resource('reports'));		
	$acl->add(new Zend_Acl_Resource('acls'));
	$acl->add(new Zend_Acl_Resource('notifications'));
	$acl->add(new Zend_Acl_Resource('faq'));
	$acl->add(new Zend_Acl_Resource('industries'));
	$acl->add(new Zend_Acl_Resource('tests'));
	$acl->add(new Zend_Acl_Resource('personality_types'));
	$acl->add(new Zend_Acl_Resource('personality_traits'));
	$acl->add(new Zend_Acl_Resource('ptests'));
	$acl->add(new Zend_Acl_Resource('questions'));
	$acl->add(new Zend_Acl_Resource('answers'));
	$acl->add(new Zend_Acl_Resource('billing'));
	$acl->add(new Zend_Acl_Resource('blog'));
	$acl->add(new Zend_Acl_Resource('literature'));
	$acl->add(new Zend_Acl_Resource('sections'));
	
	$acl->addRole(new Zend_Acl_Role('Guest'));
	$acl->addRole(new Zend_Acl_Role('Superadmin'));
	$acl->addRole(new Zend_Acl_Role('Administrator'));

	$Superadmin_Allow = array('countries', 'states', 'regions', 'cities', 'account_types', 'credit_cards', 'settings', 'companies', 'pages', 'groups', 'homepage', 'tests_categories', 'categories', 'upload', 'users', 'admins', 'languages', 'emails', 'reports', 'acls', 'notifications', 'industries', 'tests', 'ptests', 'personality_types', 'personality_traits', 'questions', 'answers', 'billing', 'faq', 'blog','literature', 'sections');
	$acl->allow('Superadmin', $Superadmin_Allow);

	$Administrator_Allow = array('countries', 'states', 'regions', 'cities', 'credit_cards', 'settings', 'companies', 'pages', 'groups', 'homepage', 'tests_categories', 'categories', 'upload', 'users', 'admins', 'languages', 'emails', 'reports', 'acls', 'notifications', 'industries', 'tests', 'ptests', 'personality_types', 'personality_traits', 'questions', 'answers', 'billing', 'faq', 'blog','literature', 'sections');
	$acl->allow('Administrator', $Administrator_Allow);
	$acl->deny('Administrator', 'admins', 'deleteItems');
	//$acl->allow('Administrator', 'account_types', 'index');
	
	$Guest_Allow = array('homepage');
	$acl->allow('Guest', 'states');
	$acl->allow('Guest', 'cities', 'loadCitiesByStateId');
	$acl->allow('Guest', 'cities', 'search_autocomplete');
	$acl->allow('Guest', 'admins', 'activation');
	$acl->allow('Guest', 'admins', 'login');
	$acl->allow('Guest', 'admins', 'prohibited_page');
	$acl->allow('Guest', 'admins', 'password_forgot');
	$acl->allow('Guest', 'admins', 'reset_password');
	$acl->allow('Guest', 'companies', 'search_autocomplete');
	$acl->allow('Guest', 'admins', 'posts');

	$acl->allow('Guest', $Guest_Allow);

	
	return $acl;
}
?>